<%--
  Created by IntelliJ IDEA.
  User: yue
  Date: 2018/5/30
  Time: 9:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <script src="js/jquery-3.3.1.js"></script>
    <link rel="stylesheet" type="text/css" href="css/easyui-themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="css/easyui-themes/icon.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/jquery.easyui.min.js"></script>
</head>
<body>
<form action="user">
    用户名：<input type="text" name="userName" id="user"/><br/>
    密&nbsp;&nbsp;码：<input type="password" name="password" id="pass"/><br/>
    <input  type="button" id="jsonBn" value="登录"/><br/>
</form>
<script>
    $(document).ready(function () {
        $("#jsonBn").click(function () {
            var u=$("#user").val();
            var p=$("#pass").val();
                if(u=="") {alert("用户名不能为空");}
                    $.ajax({
                type: "post",
                url: "user!find",
                dataType: "json",
                        async:"false",
                success: function (data) {
                    console.log(data);
                        alert("登录成功");
                },
                error: function () {
                    alert("密码错误");
                }
            });
        });
    });
</script>
</body>
</html>
